import ins from '@/utils/request.js'
// 注册接口
export const regAPI = (obj) => {
  return ins({
    method: 'post',
    url: '/api/reg',
    data: {
      ...obj
    }
  })
}
// 登录接口
export const loginAPI = (obj) => {
  return ins({
    method: 'post',
    url: '/api/login',
    data: {
      ...obj
    }
  })
}
// 获取用户信息接口
export const getuerinfoAPI = () => {
  return ins({
    method: 'get',
    url: '/my/userinfo'
  })
}
// 1.获取左侧菜单列表接口
export const getMenusAPI = () => {
  return ins({
    method: 'get',
    url: '/my/menus'
  })
}
// 修改用户信息的接口
export const updMenusAPI = (obj) => {
  console.log(obj)
  return ins({
    method: 'put',
    url: '/my/userinfo',
    data: { ...obj }
  })
}
// 用户上传头像的接口
export const updAraterAPI = (str) => {
  return ins({
    method: 'patch',
    url: '/my/update/avatar',
    data: { avatar: str }
  })
}
// 重置密码接口
export const updpwdAPI = (obj) => {
  return ins({
    method: 'patch',
    url: '/my/updatepwd',
    data: { ...obj }
  })
}
